/*
 * @lc app=leetcode.cn id=1207 lang=javascript
 *
 * [1207] 独一无二的出现次数
 */

// @lc code=start
/**
 * @param {number[]} arr
 * @return {boolean}
 */
var uniqueOccurrences = function (arr) {
  const map = {};
  arr.forEach(ch => {
    map[ch] = map[ch] ? map[ch] + 1 : 1;
  });
  const a = Object.entries(map).map(([_, num]) => num);
  return a.length === new Set(a).size;
};
// @lc code=end

